package ynu.edu.elmservlet.controller;

import ynu.edu.elmservlet.po.Business;
import ynu.edu.elmservlet.service.BusinessService;
import ynu.edu.elmservlet.service.impl.BusinessServiceImpl;
import jakarta.servlet.http.HttpServletRequest;


import java.util.List;
public class BusinessController {
    public Object listBusinessByOrderTypeId(HttpServletRequest request) throws Exception{
        Integer orderTypeId = Integer.valueOf(request.getParameter("orderTypeId"));
        BusinessService service = new BusinessServiceImpl();
        List<Business> list= service.listBusinessByOrderTypeId(orderTypeId);
        return list;
    }

    public Object getBusinessById(HttpServletRequest request) throws Exception{
        Integer businessId = Integer.valueOf(request.getParameter("businessId"));
        BusinessService service = new BusinessServiceImpl();
        Business business = service.getBusinessById(businessId);
        return business;
    }
}